/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package agenda.contatos.bsi4.database;

import com.mysql.jdbc.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author uli
 */
public class Conexao {
    public static String status = "";
    
    public static Connection getConexao(){
        Connection con = null;

        try {
            Class.forName("com.mysql.jdbc.Driver");

            con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/bsi-agenda?user=root&password=root");

            status = "Conexão Aberta";
        } catch (ClassNotFoundException e) {
            status = e.getMessage();
        } catch (SQLException e) {
            status = e.getMessage();
        } catch (Exception e) {
            status = e.getMessage();
        }

        return con;
    }
}